import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:tiktokadult/assets_tool/app_colors.dart';
import 'package:tiktokadult/hj_page/mine_business/mine_utils.dart';
import 'package:tiktokadult/hj_utils/widget_utils.dart';
import 'package:tiktokadult/tools_base/widget/common_dialog.dart';

import '../../../tools_base/global_store/store.dart';

class PaySuccessAlert extends StatelessWidget {
  const PaySuccessAlert({super.key});

  @override
  Widget build(BuildContext context) {
    return CommonDialog(
      child: _buildContent(),
    );
  }

  _buildContent() {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Text(
          "支付确认",
          style: TextStyle(
            fontSize: 20,
            color: Colors.white.withOpacity(.9),
            fontWeight: FontWeight.w500,
          ),
        ),
        12.sizeBoxH,
        0.5.line,
        12.sizeBoxH,
        Text(
          '''1.订单支付后，一般会在1-10分钟内到账，如超时未到账，请联系在线客服为您处理。
2.受特殊行业限制，如支付失败可尝试重新发起订单，系统将会随机切换备用的支付通道。
3.本APP有稳定的广告收益，产品稳定安全，请放心充值使用，如遇报毒提示忽略即可。''',
          style: TextStyle(
            color: Colors.white.withOpacity(.55),
            fontSize: 14,
            height: 1.8,
          ),
        ),
        12.sizeBoxH,
        InkWell(
            onTap: () => MineUtils.goCSPage(),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  '支付遇到问题',
                  style: TextStyle(color: Color(0xff999999), fontSize: 14),
                ),
                2.sizeBoxW,
                Icon(
                  Icons.arrow_forward_ios_outlined,
                  size: 14,
                  color: Colors.white,
                )
              ],
            )),
        24.sizeBoxH,
        InkWell(
          onTap: () {
            globalStore.updateUserInfo();
            Get.back();
          },
          child: Container(
            height: 44,
            alignment: Alignment.center,
            decoration: const BoxDecoration(
              borderRadius: BorderRadius.all(Radius.circular(3)),
              color: AppColors.actionRed,
            ),
            child: Text(
              "支付成功",
              style: TextStyle(
                fontSize: 16,
                color: Colors.white,
                fontWeight: FontWeight.w500,
              ),
            ),
          ),
        ),
      ],
    );
  }
}
